#include "Hash-tools.h"
//necessary

//TODO testing
DirectHash hashString(const char* str){
	DirectHash hash = 5381;
	int c;
	while ((c = *str++)){
		//FIXME this hash is not the best one!!!! http://dmytry.blogspot.it/2009/11/horrible-hashes.html
		hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
	}
	return hash;
}

//TODO testing
MainHash hash(DirectHash key,int iteration,unsigned int n_1,unsigned int n_2,unsigned int n){
	return ((key%n_1)+iteration*(key%n_2))%n;
}
